package net.openvision.util.logical;

import java.util.ArrayList;
import java.util.List;

/**
 * This class manages and provides variables for formulas. Every logical 
 * 
 * @author Hannes Widmoser
 * 
 */
public class Environment {
	private List<Object> values;

	public Environment(Object... values) {
		this();
		for (Object v:values) {
			this.values.add(v);
		}
	}
	
	public Environment() {
		values = new ArrayList<Object>();
	}
	
	protected Environment(Environment env) {
		//sequence = env.sequence;
		values = new ArrayList<Object>(env.values);
	}
	
	public Environment addValue(Object v) {
		Environment result = new Environment(this);
		result.values.add(v);
		return result;
	}

	public Object getValue(int index) {
		return values.get(index);
	}
	
	public Object[] getValues() {
		return (Object[])values.toArray(new Object[values.size()]);
	}

}
